import request from '@/utils/request'


export function listAIAgentGroup() {
  return request({
    url: '/api/ai/ai-agent-group/list',
    method: 'get',
    isQuery: true,
    timeout: 2000
  })
}

export function listAIAgent(query) {
  return request({
    url: '/api/ai/ai-agent/list',
    method: 'post',
    data: query,
    isQuery: true,
    timeout: 200000
  })
}


export function getAIAgent(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-agent/getDetail',
    method: 'post',
    data: data,
    isQuery: true,
    timeout: 2000
  })
}



export function initAIAgent() {
  return request({
    isLoading: true,
    url: '/api/ai/ai-agent/init',
    method: 'post',
    isQuery: false,
    timeout: 200000
  })
}

export function addAIAgent(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-agent/add',
    method: 'post',
    data:data,
    isQuery: false,
    timeout: 2000
  })
}

export function updateAIAgent(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-agent/edit',
    method: 'post',
    data:data,
    isQuery: false,
    timeout: 2000
  })
}

export function delAIAgent(ids) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-agent/delete',
    method: 'delete',
    data: {
      ids: ids
    }
  })
}

// 新增 ai-api 相关接口
export function listAIApi(data) {
  return request({
    url: '/api/ai/ai-api/list',
    method: 'post',
    data: data,
    isQuery: true,
    timeout: 2000
  })
}

export function getAIApi(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-api/getDetail',
    method: 'post',
    data: data,
    isQuery: false,
    timeout: 2000
  })
}

export function initAIApi(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-api/init',
    method: 'post',
    data: data,
    isQuery: false,
    timeout: 200000
  })
}
export function addAIApi(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-api/add',
    method: 'post',
    data: data,
    isQuery: false,
    timeout: 2000
  })
}

export function updateAIApi(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-api/edit',
    method: 'post',
    data:data,
    isQuery: false,
    timeout: 2000
  })
}

export function delAIApi(ids) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-api/delete',
    method: 'delete',
    data: {
      ids: ids
    }
  })
}

// 新增 api-model 相关接口
export function listAIModel(params) {
  return request({
    url: '/api/ai/ai-model/list',
    method: 'post',
    data: params,
    isQuery: true,
    timeout: 2000
  })
}

export function getAIModel(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-model/getDetail',
    method: 'post',
    data: data,
    isQuery: true,
    timeout: 2000
  })
}

export function addAIModel(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-model/add',
    method: 'post',
    data,
    isQuery: false,
    timeout: 2000
  })
}

export function updateAIModel(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-model/edit',
    method: 'post',
    data:data,
    isQuery: false,
    timeout: 2000
  })
}

export function delAIModel(ids) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-model/delete',
    method: 'delete',
    data: {
      ids: ids
    }
  })
}

export function lookupAIModelUseAIConfig(params) {
  return request({
    url: '/api/ai/ai-model/lookup-use-aiConfig',
    method: 'post',
    data: params,
    isQuery: true,
    timeout: 2000
  })
}

export function lookupAIAgentUseChat(params) {
  return request({
    url: '/api/ai/ai-agent/lookup-use-chat',
    method: 'post',
    data: params,
    isQuery: true,
    timeout: 2000
  })
}

export function lookupAIAgentUseAgent(params) {
  return request({
    url: '/api/ai/ai-agent/lookup-use-agent',
    method: 'post',
    data: params,
    isQuery: true,
    timeout: 2000
  })
}


// 新增 tools 相关接口
export function listAITools(params) {
  return request({
    url: '/api/ai/ai-tools/list',
    method: 'post',
    data: params,
    isQuery: true,
    timeout: 2000
  })
}

export function getAITools(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-tools/getDetail',
    method: 'post',
    data: data,
    isQuery: true,
    timeout: 2000
  })
}

export function addAITools(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-tools/add',
    method: 'post',
    data,
    isQuery: false,
    timeout: 2000
  })
}

export function updateAITools(data) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-tools/edit',
    method: 'post',
    data:data,
    isQuery: false,
    timeout: 2000
  })
}

export function delAITools(ids) {
  return request({
    isLoading: true,
    url: '/api/ai/ai-tools/delete',
    method: 'delete',
    data: {
      ids: ids
    }
  })
}
export function initAITools() {
  return request({
    isLoading: true,
    url: '/api/ai/ai-tools/init',
    method: 'post',
    isQuery: false,
    timeout: 200000
  })
}
